package com.woniu.his.cms.app.config;

import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableSwagger2
public class SwaggerConfig {


    @Bean
    public Docket createDocket() {
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        ApiInfo apiInfo = new ApiInfoBuilder().title("非药品项目前台接口文档").version("1.0")
                .description("项目的接口详情，可以直接进行测试").contact(new Contact("daixin", "http:..xxx", "daixin@woniu.com"))
                .build();

        docket.apiInfo(apiInfo);
        return docket.select()
                .apis(RequestHandlerSelectors.basePackage("com.woniu.his.cms.app.apiImpl.NonDrugApiImpl"))
                .paths(PathSelectors.any())
                .build();
    }



}
